package com.loongtech.bi.support.chart;

/**
 * chart model
 * @author Marin
 *
 */
public class ChartModel {
	private String rowkeys[] = null;        //图例，显示在图表下方，点击显示/隐藏图标曲线，目前设为yyyy-MM-dd 至 yyyy-MM-dd
	private String names[] = null;  		//图例names
	private String columnkeys[] = null;     //横坐标，目前设为yyyy-MM-dd
	private String xTitle = null;    		//图表横标题，目前设为xxxx趋势
	private String yTitle = null;    		//图表纵标题
	private Object data[][] = null;      	//int型数据，每一维为一个曲线
	private String type = ChartType.SPLINE.type;         //图表类型，目前默认为曲线型
	private long[] pieData = null;
	private Boolean percent = false;  // 是否以百分比显示

	public String[] getRowkeys() {
		return rowkeys;
	}

	public void setRowkeys(String[] rowkeys) {
		this.rowkeys = rowkeys;
	}

	public String[] getColumnkeys() {
		return columnkeys;
	}

	public void setColumnkeys(String[] columnkeys) {
		this.columnkeys = columnkeys;
	}

	public String getXTitle() {
		return xTitle;
	}

	public void setXTitle(String title) {
		xTitle = title;
	}

	public String getYTitle() {
		return yTitle;
	}

	public void setYTitle(String title) {
		yTitle = title;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Object[][] getData() {
		return data;
	}

	public void setData(Object[][] data) {
		this.data = data;
	}

	public long[] getPieData() {
		// return pieData;
		if (data != null) {
			Object[] oArray = data[0];
			pieData = new long[oArray.length];
			for (int i = 0; i < oArray.length; i++) {
				pieData[i] = Long.parseLong(oArray[i].toString());
			}
		}
		
		return pieData;
	}

	public void setPieData(long[] pieData) {
		this.pieData = pieData;
	}

	public String[] getNames() {
		return names;
	}

	public void setNames(String names[]) {
		this.names = names;
	}

	public Boolean getPercent() {
		return percent;
	}

	public void setPercent(Boolean percent) {
		this.percent = percent;
	}
}
